package org.tgcloud.group.web.controller.manager;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.*;
import org.tgcloud.group.core.APPResultMessage;
import org.tgcloud.group.core.custom.Permissions;
import org.tgcloud.group.core.session.Session;
import org.tgcloud.group.service.manager.BusinessAccountCountManageService;

import java.util.Date;

/**
 * @author: zhy
 * @create: 2024-01-09 10:01
 * @description: 商务客户统计管理相关接口
 */
@Api(tags = "商务客户统计管理相关接口")
@RestController
@RequestMapping("/manager/pc/user")
@EnableAutoConfiguration
public class BusinessAccountCountManageController extends ManageAPPBaseController{

    @Autowired
    private BusinessAccountCountManageService businessAccountCountManageService;


    @Permissions("businessAccountCount:view")
    @ApiOperation(value = "查看商务客户统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "string")
    })
    @ResponseBody
    @RequestMapping(value = "/viewBusinessAccountCount", method = RequestMethod.POST)
    public APPResultMessage viewBusinessAccountCount(@ModelAttribute("session") Session session,
                                                     @RequestParam Long startTime,
                                                     @RequestParam Long endTime){
        return businessAccountCountManageService.viewBusinessAccountCount(new Date(startTime), new Date(endTime));
    }

}
